package main

import (
	"github.com/prometheus/client_golang/prometheus"
)

var (
	// nginxProm = prometheus.NewCounterVec(
	// 	prometheus.CounterOpts {
	// 		Name: "ngx_access_prom",
	// 		Help: "counter ngx access log detail and warnning",
	// 	},
	// 	[]string{"http_host", "response", "upstream_addr"},
	// )

	// nginxSummary = prometheus.NewSummaryVec(
	// 	prometheus.SummaryOpts{
	// 		Name:       "ngx_request_summary",
	// 		Help:       "ngx request done take time.",
	// 		Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
	// 	},
	// 	[]string{"hostname", "http_host", "response", "upstream_addr"},
	// )

	nginxHistogram = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "ngx_request_histogram",
			Help:    "ngx request done take time buckets ",
			Buckets: []float64{1, 3},
		},
		[]string{"hostname", "http_host", "response", "upstream_addr"},
	)
)


// func IfInArrary(s string, array []string) bool {
// 	for _, v := range array {
// 		if strings.Contains(s, v) {
// 			return true
// 		}
// 	}
// 	return false
// }

func IfInArrary(s string, array []string) bool {
	for _, v := range array {
		if s == v {
			return true
		}
	}
	return false
}


